{% extends '@WebsiteBundle/layout/baselayout.html.twig' %}
{% block body_javascript %}
	{{ parent() }}
	<script>
		var upyunurl = "{{ path('app_my_uploadimg',{type:'gravatar'}) }}";
	</script>
	{{ encore_entry_script_tags('website_user_info') }}
{% endblock %}

{% block head_stylesheets %}
	{{ parent() }}
	{{ encore_entry_link_tags('website_user_info') }}
{% endblock %}


{% block body_main %}
	{{ parent() }}
	<div class="page">
		{{ render(path('app_header', {"route":route})) }}
		<div class="page-wrapper">
			<div class="page-body">
				<div class="container-xl">
					<div class="row row-deck row-cards">
						<div class="col-lg-2">
							{{ render(path('app_user_userNav', {route:route})) }}
						</div>
						<div class="col-lg-10">
							<div class="card">
								<div class="card-body">
									<form class="ajaxform needs-validation" action="{{ path('app_user_info_do') }}" method="post" novalidate>
										<div class="mb-3">
											<label class="form-label">头像：</label>
											<div class="mt-2">
												<img id="fileImg" class="circle" style="width: 160px;" src="{{ if_get(userInfo['gravatar'], '/images/defaultuser.png')}}"/>
												<input type="hidden" name="avatar" id="avatar" value="{{ if_get(userInfo['gravatar'], '/images/defaultuser.png')}}">
											</div>
											<div class="d-flex flex-row mb-3">
												<div class="p-2">请选择一张本地图片大小不超过2M</div>
												<div class="p-2">
													<button type="button" id="change-avatar" class="btn btn-sm btn-primary">更换</button>
												</div>
											</div>
										</div>
										<div class="mb-3">
											<label class="form-label">昵称：</label>
											<input type="text" name="displayName" autocomplete="off" placeholder="请输入昵称" class="form-control" value="{{ userInfo['displayName'] }}">
										</div>
										<div class="mb-3">
											<label class="form-label">姓名：</label>
											<input type="text" name="fullName" autocomplete="off" placeholder="请输入姓名" class="form-control" value="{{ userInfo['fullName'] }}">
										</div>
										<div class="mb-3">
											<label class="form-label">生日：</label>
											<input type="text" name="birthday" id="birthday" placeholder="请输入生日" value="{{ userInfo['birthday'] }}" autocomplete="off" class="form-control">
										</div>
										<div class="mb-3">
											<label class="form-label">性别：</label>
											<div class="input-block">
												<label class="form-check form-check-inline">
													<input type="radio" name="sex" value="1" title="男" {{ diff(1, userInfo['sex'],'checked') }}>
													<span class="form-check-label">男</span>
												</label>
												<label class="form-check form-check-inline">
													<input type="radio" name="sex" value="2" title="女" {{ diff(2, userInfo['sex'],'checked') }}>
													<span class="form-check-label">女</span>
												</label>
												<label class="form-check form-check-inline">
													<input type="radio" name="sex" value="0" title="保密" {{ diff(0, userInfo['sex'],'checked') }}>
													<span class="form-check-label">保密</span>
												</label>
											</div>
										</div>
										<div class="mb-3">
											<button type="submit" class="btn btn-primary btn-sm">提交</button>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		{{ render(path('app_footer')) }}
	</div>
{% endblock %}
